<?php include TPLPATH . 'header.html'; ?>
<div class="box">
    <table>
        <tbody>
            <tr>
                <th style="width: 46px;">ID</th>
                <th style="width: 146px;">名称</th>
                <th>权限</th>
                <th style="width: 100px;">操作</th>
            </tr>
            <?php
            if (!empty($list)) {
                $i = 0;
                foreach ($list as $val) {
            ?>
            <tr<?php if(++$i%2){ ?> class="highlight"<?php } ?>>
                <td><?php echo $val['id']; ?></td>
                <td><a title="<?php echo $val['name']; ?>" href="<?php echo jaUrl('role', 'edit', 'id='.$val['id']); ?>"><?php echo $val['name']; ?></a></td>
                <td style="padding-left: 8px; padding-right: 8px;"><?php echo implode(', ', $val['permission_names']); ?></td>
                <td class="action">
                    <ul>
                        <li><a title="edit" href="<?php echo jaUrl('role', 'edit', 'id='.$val['id']); ?>" class="edit"></a></li>
                        <li><a title="delete" href="javascript:;" onclick="if(confirm('确定删除？'))window.location.href='<?php echo jaUrl('role', 'dodelete', 'id='.$val['id']); ?>';" class="delete"></a></li>
                    </ul>
                </td>
            </tr>
            <?php
                }
            }
            ?>
        </tbody>
    </table>
    <p id="pagin">
        <?php echo $showPages; ?>
    </p>
</div>
<?php include TPLPATH . 'footer.html'; ?>
